Skip to content

Report a text in a list, not the list, from a wait (CHALLENGES 387) - #330

Merged
lana-20 merged 1 commit into
mainfrom
wait-names-what-it-found
Nov 5, 2026
Merged

lana-20 merged 1 commit into
mainfrom
wait-names-what-it-found

Conversation

@lana-20

@lana-20 lana-20 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #329.

wait and scroll-to walked up to the nearest mapped ancestor. For a plain text in a list, that was the list, and its ref tapped the list's center. The walk now stops at a list, unless the list is what matched. The match comes back with no ref, as find reports it:

testid=dialogOutcome is visible after 408ms — (no ref) nothing yet [42,651][1038,708]

This takes the issue's open choice: wait_for returns an element with an empty ref, not None. That also applies to plain text outside a list, so docs/guides/cli.md has new output.

Other changes:

  • A no-ref answer is labeled by uitree.Describe, as map labels: cleaned, bounded, never a password. find shares it.
  • app_scroll_to is listed as device text under --mark-device-text.
  • An element with no ref prints with no leading space in Python, Java and .NET. All five clients document the empty ref.

Measured

A sweep waited on the first 14 visible texts of each screen:

main This PR
Android 15 emulator 22 answers were the list 0 of 203, 9 apps
iOS 26.5 simulator 18 answers were the list 0 of 193, 8 apps

The main runs covered only MobiumApp, plus Settings on iOS. They show the sweep can catch the defect, and are not a like-for-like count. The apps include Compose, SwiftUI, Flutter and third-party ones.

All five clients and MCP took the empty ref on the Android emulator. A new section of wait-states.sh fails on main on both devices and passes here. locators, feed and mobium-app pass on both, and test-runner on Android.

Not run on a real phone.

Fixes #329. Wait and scroll-to now answer the match with no ref, as find does.

Measured with a sweep of visible texts: on main, 22 answers on the Android 15
emulator and 18 on the iOS 26.5 simulator were the list, from MobiumApp and iOS
Settings alone. With this, 0 of 203 across 9 Android apps and 0 of 193 across 8
iOS apps. All five clients and MCP took the empty ref on Android.

wait-states.sh fails on main on both devices and passes with this. locators,
feed and mobium-app pass on both, and test-runner on Android.
@lana-20
lana-20 merged commit 317cfe7 into main Nov 5, 2026
10 checks passed
@lana-20
lana-20 deleted the wait-names-what-it-found branch November 5, 2026 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wait reports the enclosing list as the element it waited for

1 participant